feat: add file exporter implementation#5207
Conversation
ocelotl
left a comment
There was a problem hiding this comment.
Lookiing good! Left some comments but in general I am ok ✌️
|
Nice addition. I ran this code locally to see the output and got |
@pmcollins Good catch, I should be writing a single line for each |
|
@pmcollins Updated. |
| return | ||
| self._shutdown = True | ||
| if self._owns_stream: | ||
| self._stream.close() |
There was a problem hiding this comment.
Is there a race condition possible here if thread A gets past the check, then thread B sets the flag and closes the stream, then thread A tries to write or flush? Could use composition and a private helper class across the three exporters: e.g. a _FileWriter with a synchronized write_line() and shutdown(). WDYT?
Description
Adds support for the OTLP JSON File exporter as outlined in OTel spec: https://opentelemetry.io/docs/specs/otel/protocol/file-exporter/
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Does This PR Require a Contrib Repo Change?
Checklist: